<template>
    <div class="addProductInfo">
        <el-card shadow="never" style="width:100% ; border:none">
            <div slot="header">
                <span class="search-title">财务信息</span>
            </div>
            <el-form :model="baseInfoForm" :rules="rules" ref="ruleForm" label-width="100px">
                <el-form-item label="开户名称" prop="accountName">
                    <el-input v-model="baseInfoForm.accountName" class="normal-input"></el-input>
                </el-form-item>
                <el-form-item label="开户银行" prop="accountBank">
                    <el-input v-model="baseInfoForm.accountBank" class="normal-input"></el-input>
                </el-form-item>
                <el-form-item label="银行账户" prop="account">
                    <el-input v-model="baseInfoForm.account" class="normal-input"></el-input>
                </el-form-item>
            </el-form>
            <!-- </el-main> -->
        </el-card>
        <!-- </el-container> -->
    </div>
</template>
<script>
import { validatInteger } from '@/utils/validate.js';
import { mapGetters } from 'vuex';
import { checkNameExist } from '@/api/supplier';
export default {
    name: 'baseInfo',
    mounted() {
        this.init();
        // 此阶段props值不一定能取到，使用路由判断
        if (this.$route.path.indexOf('update') > -1) {
            console.log(this.supplierDetailInfo);
            this.opmode = 1;
        } else {
            this.opmode = 0;
        }
    },
    computed: {
        ...mapGetters(['supplierDetailInfo'])
    },
    watch: {
        supplierDetailInfo: function() {
            this.baseInfoForm = {
                ...this.baseInfoForm,
                ...this.supplierDetailInfo
            };
        }
    },
    porps: {
        mode: 1
    },
    data() {
        return {
            opmode: 0,

            baseInfoForm: {
                accountName: '',
                accountBank: '',
                accountName: ''
            },

            rules: {}
        };
    },
    methods: {
        init() {},
        resetForm(formName) {
            this.$refs[formName].resetFields();
        },
        validateForm() {
            return this.$refs['ruleForm'].validate();
        },
        phoneChange() {
            this.baseInfoForm.phone = this.baseInfoForm.phone1 + this.baseInfoForm.phone2;
        }
    }
};
</script>

<style scoped>
.search-title {
    font-size: 18px;
    font-weight: bold;
}

.normal-input {
    width: 400px;
}
.short-input {
    width: 100px;
}
.phone-input {
    width: 295px;
}
</style>
